package UDP;
import java.net.*;
public class UDPClient {
    public static void main(String[] args) throws Exception {
        DatagramSocket client = new DatagramSocket(9999);
        byte date[] = new byte[1024];
        DatagramPacket packet = new DatagramPacket(date, date.length);
        System.out.println("[UDPClient]客户端等待服务器端发送消息....");
        client.receive(packet);
        System.out.println("[UDPClient]接收到消息，消息内容为：" +
                new String(date, 0, packet.getLength()));
        client.close();
    }
}
